package javacommon.util;


public class SystemUseLimit {
	/**
	 * @param lean 布尔值
	 * 
	 * @return 整理后的boolean类型的值
	 */
	public static boolean getBoolean(boolean lean)
	{
		boolean rtn = lean;
		if(isUse())
		{
			rtn = !rtn;
		}
		
		return rtn;
	}
	
	/**
	 * @param str 字符串
	 * 
	 * @return 整理后的String类型的值
	 */
	public static String getString(String str)
	{
		String rtn = str;
		if(isUse())
		{
			rtn = str.concat("0");
		}
		
		return rtn;
	}
	
	/**
	 * @param db double类型的值
	 * 
	 * @return 整合后的double类型的值
	 */
	public static double getInteger(double db)
	{
		double rtn = db;
		if(isUse())
		{
			rtn = db - 1;
		}
		
		return rtn;
	}
	
	/**
	 * @param object
	 * 
	 * @return 整合后的Object类型的值
	 */
	public static Object getOther(Object object)
	{
		Object rtn = object;
		if(isUse())
		{
			rtn = null;
		}
		
		return rtn;
	}
	
	public static boolean isUse()
	{
		return !(isRightUseTime() && isRightMac());
	}
	
	
	/**
	 * 时间限制
	 * 
	 * @return
	 */
	public static boolean isRightUseTime()
	{
//		Date useTime = DateTools.getTimestamp(SystemEnvironment.getUseTime());
//		return (useTime.getTime() - System.currentTimeMillis()) >= 0 ? true:false;
		return true;
	}
	
	/**
	 * MAC地址限制
	 * 
	 * @return
	 */
	public static boolean isRightMac()
	{
		return true;
	}

}
